package net.wangds.auth.department.repo.rdbms;

import net.wangds.auth.department.entity.GeneralDepartmentRoleRef;
import net.wangds.data.RemovedEnum;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface DepartmentRoleRefRepo extends JpaRepository<GeneralDepartmentRoleRef, String> {

    Optional<GeneralDepartmentRoleRef> findByDeptIdAndRoleId(String deptId, String roleId);

    List<GeneralDepartmentRoleRef> findByRoleIdAndRemoved(String roleId, RemovedEnum normal);


    List<GeneralDepartmentRoleRef> findByDeptIdAndRemoved(String deptId, RemovedEnum normal);
}
